#ifndef GSTSAVE2MP4_H
#define GSTSAVE2MP4_H

#include <QObject>
#include <QThread>
#include <gst/gst.h>

class GstSave2Mp4 : public QObject
{
    Q_OBJECT
public:
    explicit GstSave2Mp4(QObject *parent = NULL);
    static void cb_message (GstBus *bus, GstMessage *msg, gpointer *data);
    static void on_pad_added (GstElement *element,
                  GstPad     *pad,
                  gpointer    data);
    void createPipeline();
    Q_INVOKABLE void start(){
        createPipeline();
    }

    Q_INVOKABLE void stop(){
        gst_element_send_event(pipeline, gst_event_new_eos());
    }


signals:

private:

    GstElement *pipeline;
    GstElement *source;
    GstElement *audioEncoder;
    GstElement *videoEncoder;
    GstElement *muxer;
    GstElement *sink;
    GstBus *bus;

public slots:

};

#endif // GSTSAVE2MP4_H
